home *** CD-ROM | disk | FTP | other *** search
- //: C18:DataLogger.h
- // From Thinking in C++, 2nd Edition
- // Available at http://www.BruceEckel.com
- // (c) Bruce Eckel 1999
- // Copyright notice in Copyright.txt
- // Datalogger record layout
- #ifndef DATALOG_H
- #define DATALOG_H
- #include <ctime>
- #include <iostream>
-
- class DataPoint {
- std::tm time; // Time & day
- static const int bsz = 10;
- // Ascii degrees (*) minutes (') seconds ("):
- char latitude[bsz], longitude[bsz];
- double depth, temperature;
- public:
- std::tm getTime();
- void setTime(std::tm t);
- const char* getLatitude();
- void setLatitude(const char* l);
- const char* getLongitude();
- void setLongitude(const char* l);
- double getDepth();
- void setDepth(double d);
- double getTemperature();
- void setTemperature(double t);
- void print(std::ostream& os);
- };
- #endif // DATALOG_H ///:~
-